package com.zx.idc.backend.gui.common;

import com.zx.idc.backend.gui.common.BaseApi;
import com.zx.idc.backend.gui.common.base.BaseDependencyInjectionApi;
import com.zx.idc.ds.common.entity.BaseEntity;
import com.zx.idc.ds.common.service.BaseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Optional;

public class BasicServiceApi<Service extends BaseService<Entity>, Entity extends BaseEntity> extends BaseApi implements BaseDependencyInjectionApi<Service,Entity> {
    protected final Logger log = LoggerFactory.getLogger(getClass());
    /**
     * 自动注入业务类的 Bean
     */
    @SuppressWarnings({"SpringJavaInjectionPointsAutowiringInspection"})
    @Autowired
    protected Service service;

    @Override
    public Optional<Service> getService() {
        return Optional.of(service);
    }
}
